<?php
    header("Content-type:text/html;charset=utf-8");
	$userName=$_POST["userName"];
	$userId=$_POST["userId"];
	$userPwd=$_POST["userPwd"];

	// $userName="陈宝国吧1";
	// $userId=12345678909;
	// $userPwd="aA123456";

    $conn = mysql_connect("localhost","root","root");

    mysql_select_db("wanbaolong");

    $result = mysql_query("select * from user where userName='$userName'",$conn);

    if(mysql_num_rows($result) ==1){
		echo "账号已存在";
	}else{
    mysql_query("insert into user  values('$userId','$userName','$userPwd')",$conn);
    echo "注册成功";
    }
    
    //4.关闭连接
    mysql_close($conn);
?>